package com.lck.tutor.controller;

import com.lck.tutor.common.BaseResponse;
import com.lck.tutor.common.Result;
import com.lck.tutor.model.domain.Video;
import com.lck.tutor.service.VideoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author:鹿存岿
 * @date 2022/11/03 19:43
 */

@RestController
@RequestMapping("/video")
public class VideoController {

    @Resource
    private VideoService videoService;

    @GetMapping("/list")
    public BaseResponse<List<Video>> list(){
        return Result.success(videoService.list());
    }

    @GetMapping("/getVideoById/{id}")
    public BaseResponse<Video> getVideoById(@PathVariable("id") Long id){
        return Result.success(videoService.getById(id));
    }
}
